<?php
//include('../inc/connectbase.php');
$db_connexion=mysql_connect("db397684722.db.1and1.com", "dbo397684722", "concrete75") or die("impossible de se connecter a la base");
mysql_select_db("db397684722",$db_connexion);

$Agent=$_SERVER["HTTP_USER_AGENT"];
$Email=$_GET['Email'];
$idEmail=$_GET['idEmail'];
$News=$_GET['News'];
$NomTable='stat_'.$News;
$Heure=date('H');
$Minute=date('i');
$Jour=date('d');
$Mois=date("m");
$Annee=date("Y");
$req1=mysql_query("SELECT * FROM $NomTable WHERE VEmail='$Email'") or die (mysql_error());
$nbuser=mysql_num_rows($req1);
if($nbuser==0){
$req=mysql_query("INSERT INTO `$NomTable` (`idVM` , `idEmail` , `VEmail` , `Agent` , `Jour` , `Mois` , `Annee` , `Hr` , `Min`) VALUES ('', '$idEmail', '$Email', '$Agent', '$Jour', '$Mois', '$Annee', '$Heure', '$Minute')") or die (mysql_error());
}
?>